home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / ded / ded.h < prev    next >
C/C++ Source or Header  |  1984-04-30  |  1KB  |  52 lines

  1. /* $Header: ded.h,v 1.2 84/04/24 22:51:47 lepreau Exp $ */
  2.  
  3. #ifdef USG
  4. # define index strchr
  5. #endif
  6.  
  7. #ifndef S_IFLNK
  8. # define lstat stat
  9. #endif
  10.  
  11. #ifdef pdp11                /* should work */
  12. # define void int
  13. #endif
  14.  
  15. #define    FALSE        0
  16. #define    TRUE        1
  17.  
  18. #define max(a,b)    ((a) > (b) ? (a):(b))
  19. #define min(a,b)    ((a) < (b) ? (a):(b))
  20.  
  21. #define    ALLOC(type, n)        (type *) malloc((unsigned) ((n) * sizeof(type)))
  22. #define    RALLOC(type, p, n)  (type *) realloc((char *) p, (unsigned) ((n) * sizeof(type)))
  23. extern char *malloc(), *realloc();
  24.  
  25. struct lbuf {
  26.     char    *namep;            /* filename */
  27. #ifdef S_IFLNK
  28.     struct target {
  29.     int   targlen;
  30.     char  targname[1];        /* actually variable length */
  31.     } *linkto;                /* target of symlink */
  32. #define linklen(p)  (*p->linkto).targlen
  33. #define linkname(p) (*p->linkto).targname
  34. #endif
  35.     char    flg;            /* local flags */
  36.     char    ltype;            /* printable type of file */
  37.     short   namlen;            /* strlen(namep) */
  38.     short   lino;            /* inode */
  39.     short   lmode;            /* st_mode&S_IFMT */
  40.     short   lnl;            /* number of links */
  41.     unsigned short   luid;
  42.     unsigned short   lgid;
  43.     long    lsize;
  44.     time_t  latime;            /* accessed */
  45.     time_t  lmtime;            /* modified */
  46. };
  47.  
  48. /* lbuf.flg */
  49. #define STATDONE    001            /* we have stat`ed this file */
  50. #define DELETED        002            /* marked for deletion */
  51. #define RDLINKDONE  004            /* we have done the readlink() */
  52.